package sk.naive.talker.command;

import sk.naive.talker.props.PropertyStoreException;
import sk.naive.talker.util.Utils;
import sk.naive.talker.message.DefaultMessageFactory;

import java.rmi.*;

/**
 * Time displays date and time.
 *
 * <a href="mailto:maslenka@naive.deepblue.sk">Zuzana "Maslenka" Maslenova</a>
 * @version $Revision: 1.3 $ $Date: 2005/01/16 22:20:48 $
 */
public class Time extends AbstractCommand {
	public void exec()
		throws RemoteException, PropertyStoreException
	{
		long current = System.currentTimeMillis();
		ctxSet(DefaultMessageFactory.CTXKEY_VAL + "currentDate", Utils.createDate(current));
		user.send(getString("time.msg", user.getProperties()));
	}
}
